package com.hntest.entity;

import java.util.Date;

public class BaseAuditDomain {
    private static final long serialVersionUID = 1L;
    public static final int STATE_APPLY = 0;//申请状态
    public static final int STATE_PASS = 1;//审核通过
    public static final int STATE_REJECT = 2;//审核拒绝

    private String remark;//审核记录
    private Logininfo applier;//申请人
    private Logininfo auditor;//审核者
    private Date auditTime;//审核时间
    private Date applyTime = new Date();//申请时间
    private int state = STATE_APPLY;//状态

    public String getRemark() {
        return remark;
    }

    public void setRemark(String remark) {
        this.remark = remark;
    }

    public Logininfo getApplier() {
        return applier;
    }

    public void setApplier(Logininfo applier) {
        this.applier = applier;
    }

    public Logininfo getAuditor() {
        return auditor;
    }

    public void setAuditor(Logininfo auditor) {
        this.auditor = auditor;
    }

    public Date getAuditTime() {
        return auditTime;
    }

    public void setAuditTime(Date auditTime) {
        this.auditTime = auditTime;
    }

    public Date getApplyTime() {
        return applyTime;
    }

    public void setApplyTime(Date applyTime) {
        this.applyTime = applyTime;
    }

    public int getState() {
        return state;
    }

    public void setState(int state) {
        this.state = state;
    }

    public String getStateDisplay(){
        switch (state){
            case STATE_APPLY:
                return "申请状态";
            case STATE_PASS:
                return "审核通过";
            case STATE_REJECT:
                return "审核拒绝";
            default:
                return "错误状态";
        }
    }

    @Override
    public String toString() {
        return "BaseAuditDomain{" +
                "remark='" + remark + '\'' +
                ", applier=" + applier.getUsername() +
                ", auditor=" + auditor.getUsername() +
                ", auditTime=" + auditTime +
                ", applyTime=" + applyTime +
                ", state=" + state +
                '}';
    }
}
